Skip to main content
Version: 4.2.2

Dashboard View Model

Instantiate the DashboardViewModel class found within the InfoArch.Web.Mvc.Dashboard namespace, allows us to configure all settings that the dashboard component require. This class facilitates the configuration of dashboard settings, encompassing tasks such as establishing database connections and configuring link for the save of status and link for the execution of drill-through reports.

Constructors

NameDescription
DashboardViewModel()Initializes a new instance of the DashboardViewModel class.
DashboardViewModel(parameters)Initializes a new instance of the DashboardViewModel class.

DashboardViewModel() Constructor

This is the default constructor for the DashboardViewModel class, which creates a new instance and initializes all properties to their default values.

DashboardViewModel(parameters) Constructor

This is the main constructor, it has the following parameters:

ParameterTypeDescription
memoryStreamMemoryStreamRepresents in-memory data flow for a dashboard definition (.dDashX).
connectionStringstringThe connection string used by the component to retrieve its data. See connection strings.
dashboardIdstringDefinition Identifier
filterComponentParentIdstringHTML identifier of the parent element where the filter component is included, if no filters are included. It may be empty
fullGridControllerActionPathstringA String object that specifies the absolute path where the application is hosted to perform the build of the internal paths handle by the component.
The recommended path could be the following: HttpContext.Request.Url.AbsolutePath
drillThroughControllerActionstringA String object that specifies the controller action method to perform the drill-through execution.
saveDashboardControllerActionstringA String object that specifies the controller action method to perform the save state action.
htmlFormIdstringForm Identifier of the element containing the dashboard component.
useNewExportToImageProbooltrue, to enable the export to image pro mode; otherwise, false.
excelXlsxExportControllerActionstringA String object that specifies the controller action method to perform the Excel exportation action.

Methods

SetState

Sets the state of the dashboard. It receives a DRevealDataStructure object with the current state of the Dashboard component.

Definition

public void SetState(DRevealDataStructure dashboardState)

SetParameters

Sets the global parameters the parameters can be created in the dashboard definition from its designer, and assigned from the web dashboard component programmatically. It receives a ParameterItems object provided by the hosting application.

Definition

public void SetParameters(ParameterItems userParameters)

SetCulture

Sets culture and receives a CultureInfo object provided by the hosting application.

Definition

public void SetCulture(CultureInfo clientCulture)

LoadDataDrillThrough

Loads the Drill-Through structure when the action excecuted is perform Drill-Through on dashboard component. It receives a string object that has parameters required for build it.

Definition

public void LoadDataDrillThrough(string drillThroughParameters)

Serialize

Serializes all structures needed to save dashboard component status.

Definition

public string Serialize()

Returns string object encrypted.

AssignUserCustomizationDefinitionModel

Assigns the user customization definition model. It receives an encrypted string object, which is the result of the Serialize method.

Definition

public void AssignUserCustomizationDefinitionModel(string userCustomization)

UpdateCustomization

Updates the user customization properties, including applied filters and conditions within the dashboard component.

Definition

public void UpdateCustomization()

SetCleanColumnsOption

Sets the setting to remove unused columns in the database query generated by the dashboard component.

Definition

public void SetCleanColumnsOption(bool clean)

EnablePivotExportExcelObject

Enables or disables a value to indicate whether the pivot export Excel object is enabled to export by the dashboard component.

Definition

public void EnablePivotExportExcelObject(bool enable)

LoadInitialConfiguration

The LoadInitialConfiguration method in DashboardViewModel initializes the configuration and prepare the all properties required by the dashboard component.

Example

DashboardViewModel viewModel = new DashboardViewModel(
memoryStream: fileStream,
connectionString: " Data Source=MyServer; Initial Catalog=myDatabase; User ID=myUser; Password=myPassword",
dashboardId: "dashboard_id",
htmlFormId: "main_form",
fullGridControllerActionPath: HttpContext.Request.Url.AbsolutePath,
useNewExportToImagePro: true,
filterComponentParentId: string.Empty,
drillThroughControllerAction: string.Empty,
saveDashboardControllerAction: string.Empty,
excelXlsxExportControllerAction: string.Empty
);

viewModel.LoadInitialConfiguration();